#!/bin/sh

usage_help()
{
    echo "$0: -s <server> -p <port> [-h <help ]"
    exit $1
}

if [ $# -eq 0 ]; then
    usage_help 1
fi

while getopts s:p:l:h OPT
do
    case $OPT in
	s)	SERVER=${OPTARG}
	    	;;
	p)	PORT=${OPTARG}
	    	;;
	l)	LOGFILE=${OPTARG}
	    	;;
	h)	usage_help 0
	    	;;
	\?)	usage_help 1
	    	;;
    esac
done

if [ -z ${SERVER} -o -z ${PORT} ]; then
    usage_help 1
fi

LOGFILE="`mktemp`"

echo "Run command \"tail -f ${LOGFILE}\""

SITES1="www.google.com www.facebook.com www.redhat.com www.microsoft.com www.nascomm.com www.yahoo.com www.gmail.com www.twitter.com www.sun.com www.oracle.com www.deepak.com www.jaymin.com www.hkrunalasd.com www.deepak.com www.jaymin.com www.hkrunalasd.com www.krunal.com www.patel.com www.jangid.com www.vipul.com"

SITES=" www.google.com mail.google.com www.youtube.com www.google.de www.google.com www.google.it www.google.fr apps.facebook.com www.google.co.uk www.facebook.com en.wikipedia.org login.live.com login.yahoo.com www.google.pl www.yahoo.com twitter.com www.google.es www.amazon.com www.bbc.co.uk www.google.ca cgi.ebay.de encrypted.google.com login.live.com de.wikipedia.org www.ig.gmodules.com www.google.com.au www.bing.com mail.google.com www.spiegel.de cgi.ebay.com www.mozilla.com xhamster.com www.repubblica.it www.LINKEDIN.COM my.ebay.de search.yahoo.com maps.google.com www.t-online.de www.imdb.com news.yahoo.com www.bild.de shop.ebay.de news.google.com www.gmx.net www.google.ch www.paypal.com docs.google.com www.msn.com www.google.co.in logout.webde.uimserv.net www.google.co.jp toolbar.netcraft.com www.onet.pl www.ebay.de www.cnn.com web.de translate.google.com www.google.nl www.megaupload.com www.chip.de mail.aol.com my.yahoo.com news.bbc.co.uk www.amazon.com de-de.facebook.com allegro.pl www.google.co.id www.google.com.br www.flickr.com creatives.livejasmin.com www.nytimes.com www.xvideos.com service.gmx.net www.microsoft.com finance.yahoo.com it.wikipedia.org maps.google.de signin.ebay.de www.rejas.se service.gmx.net shop.ebay.com nk.pl addons.mozilla.org www.corriere.it www.wer-kennt-wen.de www.orange.fr my.ebay.com www.heise.de logout.gmx.uimserv.net www.web.de fr.yahoo.com webcache.googleusercontent.com www.amazon.co.uk www.google.be fr-fr.facebook.com cgi.ebay.co.uk fr.wikipedia.org www.leboncoin.fr se.howrse.com"

for url in ${SITES}
do
    ./alookup_client -s ${SERVER} -p ${PORT} -f ${url} >> ${LOGFILE} 2>&1 &
done
